import { createRouter, createWebHashHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import type { App } from 'vue'
import { Layout, getParentLayout } from '@/utils/routerHelper'
import { useI18n } from '@/hooks/web/useI18n'

const { t } = useI18n()

export const constantRouterMap: AppRouteRecordRaw[] = [

  {
    path: '/',
    component: Layout,
    redirect: '/dashboard/analysis',
    name: 'Root',
    meta: {
      hidden: true
    }
  },
  {
    path: '/redirect',
    component: Layout,
    name: 'Redirect',
    children: [
      {
        path: '/redirect/:path(.*)',
        name: 'Redirect',
        component: () => import('@/views/Redirect/Redirect.vue'),
        meta: {}
      }
    ],
    meta: {
      hidden: true,
      noTagsView: true
    }
  },
  {
    path: '/login',
    component: () => import('@/views/Login/Login.vue'),
    name: 'Login',
    meta: {
      hidden: true,
      title: t('router.login'),
      noTagsView: true
    }
  },
  {
    path: '/404',
    component: Layout,
    name: 'Shou',
    meta: {
      title: '首頁',
      icon: 'material-symbols:10k-rounded',
      alwaysShow: true
    },
    children: [
      {
        path: 'xitongshouye',
        component: () => import('@/views/Shouye/Analysis.vue'),
        name: 'xitongshouye',
        meta: {
          title: '系统首页',
          noCache: true
        }
      },
      {
        path: 'zhanghushezhi',
        component: () => import('@/views/Shouye/AccountSettings.vue'),
        name: 'zhnaghushezhi',
        meta: {
          title: '账户设置',
          noCache: true
        }
      },
      {
        path: 'xitongshezhi',
        component: () => import('@/views/Shouye/SystemInformation.vue'),
        name: 'xitongshezhi',
        meta: {
          title: '系统信息',
          noCache: true
        }
      },
      {
        path: 'denglurizhi',
        component: () => import('@/views/Shouye/Register_log.vue'),
        name: 'denglurizhi',
        meta: {
          title: '登录日志',
          noCache: true
        }
      }
    ]
  },
]

export const asyncRouterMap: AppRouteRecordRaw[] = [
  //郑东平
  {
    path: '/external-link',
    component: Layout,
    meta: {
      title: t('page.microsphere'),
      icon: 'clarity:document-solid',
      alwaysShow: true
    },
    name: '微圈',
    children: [
      {
        path: 'lookmicrosphere',
        component: () => import('@/views/vCircle/LookVcircle3.vue'),
        name: '微圈',
        meta: {
          title: t('page.lookmicrosphere'),
          icon: 'clarity:document-solid'
        }
      },
      {
        path: 'lookVcircle3—detail',
        component: () => import('@/views/vCircle/LookVcircle3Detail.vue'),
        name: '详情',
        meta: {
          title: '详情',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/vCircle/LookVcircle3Detail'
        }
      },
      {
        path: 'WeiQuanVudit',
        component: () => import('@/views/vCircle/AUditWeiQuan.vue'),
        name: '微圈审核',
        meta: {
          title: "微圈审核",
          icon: 'cib:telegram-plane'
        }
      }
    ]
  },
    //宋英杰
  {
    path: '/techer',
    component: Layout,
    redirect: '/techer/course/courselist',
    name: 'techer',
    meta: {
      title: '教师',
      icon: 'svg-icon:shopping',
      alwaysShow: true
    },
    children: [
      {
        path: 'course',
        component: Layout,
        redirect: '/techer/course/courselist',
        name: 'Course',
        meta: {
          title: '课程',
          alwaysShow: true
        },
        children: [
          {
            path: 'courselist',
            name: 'Courselist',
            component: () => import('@/views/Course/Courselist.vue'),
            meta: {
              title: '课程列表'
            }
          },
          {
            path: 'courseadd',
            name: 'courseadd',
            component: () => import('@/views/Course/CourseAdd.vue'),
            meta: {
              title: '添加课程'
            }
          },
        ]
      },
    ]
  },
  {
    path: '/coupon',
    component: Layout,
    redirect: '/coupon/couponList',
    name: 'coupon',
    meta: {
      icon: 'svg-icon:shopping',
      title: '优惠券',
      alwaysShow: true
    },
    children: [
      {
        path: 'couponList',
        name: 'couponList',
        component: ()=>import('@/views/Coupon/UserCoupon.vue'),
        meta: {
          title: '优惠券列表',
        }
      },
      {
        path: 'useCouponList',
        name: 'useCouponList',
        component: ()=>import('@/views/Coupon/UseCoupon.vue'),
        meta: {
          title: '赠送优惠券',
        }
      },

    ]
  },
  /*{
    path: '/dashboard',
    component: Layout,
    redirect: '/dashboard/analysis',
    name: 'Dashboard',
    meta: {
      title: t('router.dashboard'),
      icon: 'ant-design:dashboard-filled',
      alwaysShow: true
    },
    children: [
      {
        path: 'analysis',
        component: () => import('@/views/Dashboard/Analysis.vue'),
        name: 'Analysis',
        meta: {
          title: t('router.analysis'),
          noCache: true,
          affix: true
        }
      },
      {
        path: 'workplace',
        component: () => import('@/views/Dashboard/Workplace.vue'),
        name: 'Workplace',
        meta: {
          title: t('router.workplace'),
          noCache: true
        }
      }
    ]
  },
  {
    path: '/external-link',
    component: Layout,
    meta: {},
    name: 'ExternalLink',
    children: [
      {
        path: 'https://element-plus-admin-doc.cn/',
        name: 'DocumentLink',
        meta: {
          title: t('router.document'),
          icon: 'clarity:document-solid'
        }
      }
    ]
  },
  {
    path: '/guide',
    component: Layout,
    name: 'Guide',
    meta: {},
    children: [
      {
        path: 'index',
        component: () => import('@/views/Guide/Guide.vue'),
        name: 'GuideDemo',
        meta: {
          title: t('router.guide'),
          icon: 'cib:telegram-plane'
        }
      }
    ]
  },
  {
    path: '/components',
    component: Layout,
    name: 'ComponentsDemo',
    meta: {
      title: t('router.component'),
      icon: 'bx:bxs-component',
      alwaysShow: true
    },
    children: [
      {
        path: 'form',
        component: getParentLayout(),
        redirect: '/components/form/default-form',
        name: 'Form',
        meta: {
          title: t('router.form'),
          alwaysShow: true
        },
        children: [
          {
            path: 'default-form',
            component: () => import('@/views/Components/Form/DefaultForm.vue'),
            name: 'DefaultForm',
            meta: {
              title: t('router.defaultForm')
            }
          },
          {
            path: 'use-form',
            component: () => import('@/views/Components/Form/UseFormDemo.vue'),
            name: 'UseForm',
            meta: {
              title: 'UseForm'
            }
          },
          {
            path: 'ref-form',
            component: () => import('@/views/Components/Form/RefForm.vue'),
            name: 'RefForm',
            meta: {
              title: 'RefForm'
            }
          }
        ]
      },
      {
        path: 'table',
        component: getParentLayout(),
        redirect: '/components/table/default-table',
        name: 'TableDemo',
        meta: {
          title: t('router.table'),
          alwaysShow: true
        },
        children: [
          {
            path: 'default-table',
            component: () => import('@/views/Components/Table/DefaultTable.vue'),
            name: 'DefaultTable',
            meta: {
              title: t('router.defaultTable')
            }
          },
          {
            path: 'use-table',
            component: () => import('@/views/Components/Table/UseTableDemo.vue'),
            name: 'UseTable',
            meta: {
              title: 'UseTable'
            }
          },
          {
            path: 'ref-table',
            component: () => import('@/views/Components/Table/RefTable.vue'),
            name: 'RefTable',
            meta: {
              title: 'RefTable'
            }
          }
        ]
      },
      {
        path: 'editor-demo',
        component: getParentLayout(),
        redirect: '/components/editor-demo/editor',
        name: 'EditorDemo',
        meta: {
          title: t('router.editor'),
          alwaysShow: true
        },
        children: [
          {
            path: 'editor',
            component: () => import('@/views/Components/Editor/Editor.vue'),
            name: 'Editor',
            meta: {
              title: t('router.richText')
            }
          }
        ]
      },
      {
        path: 'search',
        component: () => import('@/views/Components/Search.vue'),
        name: 'Search',
        meta: {
          title: t('router.search')
        }
      },
      {
        path: 'descriptions',
        component: () => import('@/views/Components/Descriptions.vue'),
        name: 'Descriptions',
        meta: {
          title: t('router.descriptions')
        }
      },
      {
        path: 'image-viewer',
        component: () => import('@/views/Components/ImageViewer.vue'),
        name: 'ImageViewer',
        meta: {
          title: t('router.imageViewer')
        }
      },
      {
        path: 'dialog',
        component: () => import('@/views/Components/Dialog.vue'),
        name: 'Dialog',
        meta: {
          title: t('router.dialog')
        }
      },
      {
        path: 'icon',
        component: () => import('@/views/Components/Icon.vue'),
        name: 'Icon',
        meta: {
          title: t('router.icon')
        }
      },
      {
        path: 'echart',
        component: () => import('@/views/Components/Echart.vue'),
        name: 'Echart',
        meta: {
          title: t('router.echart')
        }
      },
      {
        path: 'count-to',
        component: () => import('@/views/Components/CountTo.vue'),
        name: 'CountTo',
        meta: {
          title: t('router.countTo')
        }
      },
      {
        path: 'qrcode',
        component: () => import('@/views/Components/Qrcode.vue'),
        name: 'Qrcode',
        meta: {
          title: t('router.qrcode')
        }
      },
      {
        path: 'highlight',
        component: () => import('@/views/Components/Highlight.vue'),
        name: 'Highlight',
        meta: {
          title: t('router.highlight')
        }
      },
      {
        path: 'infotip',
        component: () => import('@/views/Components/Infotip.vue'),
        name: 'Infotip',
        meta: {
          title: t('router.infotip')
        }
      },
      {
        path: 'input-password',
        component: () => import('@/views/Components/InputPassword.vue'),
        name: 'InputPassword',
        meta: {
          title: t('router.inputPassword')
        }
      },
      {
        path: 'sticky',
        component: () => import('@/views/Components/Sticky.vue'),
        name: 'Sticky',
        meta: {
          title: t('router.sticky')
        }
      }
    ]
  },
  {
    path: '/hooks',
    component: Layout,
    redirect: '/hooks/useWatermark',
    name: 'Hooks',
    meta: {
      title: 'hooks',
      icon: 'ic:outline-webhook',
      alwaysShow: true
    },
    children: [
      {
        path: 'useWatermark',
        component: () => import('@/views/hooks/useWatermark.vue'),
        name: 'UseWatermark',
        meta: {
          title: 'useWatermark'
        }
      },
      {
        path: 'useCrudSchemas',
        component: () => import('@/views/hooks/useCrudSchemas.vue'),
        name: 'UseCrudSchemas',
        meta: {
          title: 'useCrudSchemas'
        }
      }
    ]
  },
  {
    path: '/level',
    component: Layout,
    redirect: '/level/menu1/menu1-1/menu1-1-1',
    name: 'Level',
    meta: {
      title: t('router.level'),
      icon: 'carbon:skill-level-advanced'
    },
    children: [
      {
        path: 'menu1',
        name: 'Menu1',
        component: getParentLayout(),
        redirect: '/level/menu1/menu1-1/menu1-1-1',
        meta: {
          title: t('router.menu1')
        },
        children: [
          {
            path: 'menu1-1',
            name: 'Menu11',
            component: getParentLayout(),
            redirect: '/level/menu1/menu1-1/menu1-1-1',
            meta: {
              title: t('router.menu11'),
              alwaysShow: true
            },
            children: [
              {
                path: 'menu1-1-1',
                name: 'Menu111',
                component: () => import('@/views/Level/Menu111.vue'),
                meta: {
                  title: t('router.menu111')
                }
              }
            ]
          },
          {
            path: 'menu1-2',
            name: 'Menu12',
            component: () => import('@/views/Level/Menu12.vue'),
            meta: {
              title: t('router.menu12')
            }
          }
        ]
      },
      {
        path: 'menu2',
        name: 'Menu2',
        component: () => import('@/views/Level/Menu2.vue'),
        meta: {
          title: t('router.menu2')
        }
      }
    ]
  },

  {
    path: '/example',
    component: Layout,
    redirect: '/example/example-dialog',
    name: 'Example',
    meta: {
      title: t('router.example'),
      icon: 'ep:management',
      alwaysShow: true
    },
    children: [
      {
        path: 'example-dialog',
        component: () => import('@/views/Example/Dialog/ExampleDialog.vue'),
        name: 'ExampleDialog',
        meta: {
          title: t('router.exampleDialog')
        }
      },
      {
        path: 'example-page',
        component: () => import('@/views/Example/Page/ExamplePage.vue'),
        name: 'ExamplePage',
        meta: {
          title: t('router.examplePage')
        }
      },
      {
        path: 'example-add',
        component: () => import('@/views/Example/Page/ExampleAdd.vue'),
        name: 'ExampleAdd',
        meta: {
          title: t('router.exampleAdd'),
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/example/example-page'
        }
      },
      {
        path: 'example-edit',
        component: () => import('@/views/Example/Page/ExampleEdit.vue'),
        name: 'ExampleEdit',
        meta: {
          title: t('router.exampleEdit'),
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/example/example-page'
        }
      },
      {
        path: 'example-detail',
        component: () => import('@/views/Example/Page/ExampleDetail.vue'),
        name: 'ExampleDetail',
        meta: {
          title: t('router.exampleDetail'),
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/example/example-page'
        }
      }
    ]
  },
  {
    path: '/error',
    component: Layout,
    redirect: '/error/404',
    name: 'Error',
    meta: {
      title: t('router.errorPage'),
      icon: 'ci:error',
      alwaysShow: true
    },
    children: [
      {
        path: '404-demo',
        component: () => import('@/views/Error/404.vue'),
        name: '404Demo',
        meta: {
          title: '404'
        }
      },
      {
        path: '403-demo',
        component: () => import('@/views/Error/403.vue'),
        name: '403Demo',
        meta: {
          title: '403'
        }
      },
      {
        path: '500-demo',
        component: () => import('@/views/Error/500.vue'),
        name: '500Demo',
        meta: {
          title: '500'
        }
      }
    ]
  },*/
    //王姿
  {
    path:'/tongJi',
    component:Layout,
    redirect:'/TongJi/ShouCangDeKeCheng',
    name:'TongJi',
    meta: {
      title: '统计',
      icon: 'ic:baseline-assessment',
      alwaysShow: true
    },
    children:[
      {
        path:'收藏的课程',
        component:() => import("@/views/TongJi/ShouCangDeKeCheng.vue"),
        name: 'scdkc',
        meta:{
          title: "收藏的课程"
        }
      },
      {
        path:'课程点赞热度',
        component:() => import("@/views/TongJi/KeChengDianZanReDu.vue"),
        name: 'kcdztj',
        meta:{
          title: "课程点赞热度"
        }
      },
      {
        path: "微圈点赞统计",
        component:() => import("@/views/TongJi/WeiQuanDianZan.vue"),
        name: 'wqdztj',
        meta:{
          title: "微圈点赞统计"
        }
      },
      {
        path:'搜索关键字统计',
        component:() => import("@/views/TongJi/SouSuoGuanJianZiTongJi.vue"),
        name: 'ssgjztj',
        meta:{
          title: "搜索关键字统计"
        }
      },
      {
        path:'课程观看量统计',
        component:() => import("@/views/TongJi/KeChengGuanKanLiangTongJi.vue"),
        name: 'kcgkltj',
        meta:{
          title: "课程观看量统计"
        }
      },
      {
        path:'微圈浏览量统计',
        component:() => import("@/views/TongJi/WeiQuanLiuLanLiangTongJi.vue"),
        name: 'wqllltj',
        meta:{
          title: "微圈浏览量统计"
        }
      },
    ]
  },
    //杨聪
  {
    path: '/product',
    component: Layout,
    redirect: '/hooks/useWatermark',
    name: 'Product',
    meta: {
      title: '商品',
      icon: 'svg-icon:shopping',
      alwaysShow: true
    },
    children: [
      {
        path: 'productList',
        component: () => import('@/views/Product/ProductList/ProductList.vue'),
        name: 'ProductList',
        meta: {
          title: '商品列表'
        }
      },
      {
        path: 'processProductList',
        component: () => import('@/views/Product/ProcessProductList/ProcessProductList.vue'),
        name: 'ProcessProductList',
        meta: {
          title: '审核商品列表'
        }
      },
      {
        path: 'operationLog',
        component: () => import('@/views/Product/OperationLog/OperationLog.vue'),
        name: 'OperationLog',
        meta: {
          title: '操作日志'
        }
      },
      {
        path: 'processProductLog',
        component: () => import('@/views/Product/ProcessProductLog/ProcessProductLog.vue'),
        name: 'ProcessProductLog',
        meta: {
          title: '审核商品日志'
        }
      },
      {
        path: 'product-add',
        component: () => import((`@/views/Product/ProductList/ProductAdd.vue`)),
        name: 'productAdd',
        meta: {
          title: '商品列表添加',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/product/produceList'
        }
      },
      {
        path: 'product-bianji',
        component: () => import('@/views/Product/ProductList/Productbianji.vue'),
        name: 'Productbianji',
        meta: {
          title: '商品列表编辑',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/product/produceList'
        }
      },
      {
        path: 'product-chakan',
        component: () => import('@/views/Product/ProductList/Productchakan.vue'),
        name: 'Productchakan',
        meta: {
          title: '商品列表查看',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/product/produceList'
        }
      },
      {
        path: 'process-chakan',
        component: () => import('@/views/Product/ProcessProductList/Processchakan.vue'),
        name: 'Processchakan',
        meta: {
          title: '审核商品查看',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/product/processProductList'
        }
      },
      {
        path: 'process-shenhe',
        component: () => import('@/views/Product/ProcessProductList/Processshenhe.vue'),
        name: 'Processshenhe',
        meta: {
          title: '审核',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/product/processProductList'
        }
      }
    ]
  },
  {
    path: '/comment',
    component: Layout,
    redirect: '/hooks/useWatermark',
    name: 'Comment',
    meta: {
      title: '评论',
      icon: 'svg-icon:message',
      alwaysShow: true
    },
    children: [
      {
        path: 'productComment',
        component: () => import('@/views/Comment/ProductComment/ProductComment.vue'),
        name: 'ProductComment',
        meta: {
          title: '商品评论'
        }
      },
      {
        path: 'courseComment',
        component: () => import('@/views/Comment/CourseComment/CourseComment.vue'),
        name: 'CourseComment',
        meta: {
          title: '课程评论'
        }
      },
      {
        path: 'microcircleComment',
        component: () => import('@/views/Comment/MicrocircleComment/MicrocircleComment.vue'),
        name: 'MicrocircleComment',
        meta: {
          title: '微圈评论'
        }
      },
      {
        path: 'iComment',
        component: () => import('@/views/Comment/IComment/IComment.vue'),
        name: 'IComment',
        meta: {
          title: '个人评论'
        }
      },
      {
        path: 'course-chakan',
        component: () => import('@/views/Comment/CourseComment/Coursechakan.vue'),
        name: 'Coursechakan',
        meta: {
          title: '课程评论查看',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/comment/courseComment'
        }
      },
      {
        path: 'microcircle-chakan',
        component: () => import('@/views/Comment/MicrocircleComment/Microcirclechakan.vue'),
        name: 'Microcirclechakan',
        meta: {
          title: '微圈评论查看',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/comment/MicrocircleComment'
        }
      }
    ]
  },
    //郭磊
  {
    path: '/rotograph',
    component: Layout,
    name: 'Rotograph',
    meta: {
      title: '广告',
      icon: 'ri:advertisement-fill',
      alwaysShow: true
    },
    children: [
      {
        path: 'advertisement',
        component: () => import('@/views/Advertisement/Advertisement.vue'),
        name: 'Advertisement',
        meta: {
          title: '轮播图列表'
        }
      },
      {
        path: 'advertisementAdd',
        component: () => import('@/views/Advertisement/AdvertisementAdd.vue'),
        name: 'AdverAdd',
        meta: {
          title: '添加轮播图'
        }
      },
      {
        path: 'advertisement-detail',
        component: () => import('@/views/Advertisement/AdverDetail.vue'),
        name: 'AdvertisementDetail',
        meta: {
          title: '查看轮播图',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/rotograph/advertisement'
        }
      },
      {
        path: 'advertisement-edit',
        component: () => import('@/views/Advertisement/AdverEdit.vue'),
        name: 'AdvertisementEdit',
        meta: {
          title: '编辑轮播图',
          noTagsView: true,
          noCache: true,
          hidden: true,
          canTo: true,
          activeMenu: '/rotograph/advertisement'
        }
      }
    ]
  },
  {
    path: '/users',
    component: Layout,
    name: 'Users',
    meta: {
      title: '用户',
      icon: 'svg-icon:shopping',
      alwaysShow: true
    },
    children: [
      {
        path: 'usercrm',
        component: Layout,
        name: 'Usercrm',
        meta: {
          title: '用户管理',
          icon: 'cib:telegram-plane',
          alwaysShow: true
        },
        children: [
          {
            path: 'userlist',
            component: () => import('@/views/Users/Userlist.vue'),
            name: 'Userlist',
            meta: {
              title: '用户列表',
            },
          },
          {
            path: 'jsuserlist',
            component: () => import('@/views/Advertisement/AdverEdit.vue'),
            name: 'JsUserlist',
            meta: {
              title: '进思用户列表',
            },
          },
          {
            path: 'fjsuserlist',
            component: () => import('@/views/Advertisement/AdverEdit.vue'),
            name: 'FjsUserlist',
            meta: {
              title: '非进思用户列表',
            },
          },
          {
            path: 'wbsqrylist',
            component: () => import('@/views/Advertisement/AdverEdit.vue'),
            name: 'Wbsqrylist',
            meta: {
              title: '外部申请人员列表',
            },
          },
          {
            path: 'fhlist',
            component: () => import('@/views/Advertisement/AdverEdit.vue'),
            name: 'Fhlist',
            meta: {
              title: '封号列表',
            }
          },
          {
            path: 'lxflist',
            component: () => import('@/views/Advertisement/AdverEdit.vue'),
            name: 'Lxflist',
            meta: {
              title: '零消费列表统计',
            }
          }
        ]
      },
      {
        path: 'audtment',
        component: Layout,
        name: 'Audtment',
        meta: {
          title: '审核管理',
          icon: 'cib:telegram-plane',
          alwaysShow: true
        },
        children: [
          {
            path: 'sqryshlist',
            component: () => import('@/views/Advertisement/AdverEdit.vue'),
            name: 'Sqryshlist',
            meta: {
              title: '申请人员审核列表',

            },
          },
          {
            path: 'sqbhlist',
            component: () => import('@/views/Advertisement/AdverEdit.vue'),
            name: 'Sqbhlist',
            meta: {
              title: '申请驳回列表',

            },
          },
          {
            path: 'shjl',
            component: () => import('@/views/Advertisement/AdverEdit.vue'),
            name: 'Shjl',
            meta: {
              title: '审核记录',
            },
          },
        ]
      }
    ]
  },
    //王义博
  {
    path: '/orderHzq',
    component: Layout,
    redirect: '/orderHzq/OrderList',
    name: 'OrderHzq',
    meta: {
      title: t('orderHzq.order'),
      icon: 'ant-design:dashboard-filled',
      alwaysShow: true
    },
    children: [
      {
        path: 'orderList',
        component: () => import('@/views/Order/OrderList.vue'),
        name: 'OrderList',
        meta: {
          title: t('orderHzq.orderList'),
          noCache: true,
          affix: true
        }
      },
      {
        path: 'curriculumList',
        component: () => import('@/views/Order/CurriculumList.vue'),
        name: 'CurriculumList',
        meta: {
          title: t('orderHzq.curriculumList'),
          noCache: true,
          affix: true
        }
      },
      {
        path: 'returnList',
        component: () => import('@/views/Order/ReturnList.vue'),
        name: 'ReturnList',
        meta: {
          title: t('orderHzq.returnList'),
          noCache: true,
          affix: true
        }
      }
    ]
  },
  {
    path: '/power',
    component: Layout,
    redirect: '',
    name: 'power',
    meta: {
      title: t('powerHzq.power'),
      icon: 'carbon:skill-level-advanced'
    },
    children: [
      {
        path: 'power1',
        name: 'Power1',
        component: getParentLayout(),
        redirect: '/level/menu1/menu1-1/menu1-1-1',
        meta: {
          title: t('powerHzq.PermissionManagement')
        },
        children: [
          {
            path: 'power1-1',
            name: 'Power1-1',
            component: () => import('@/views/Power/DmList.vue'),
            meta: {
              title: t('powerHzq.Dml')
            }
          },
          {
            path: 'power1-2',
            name: 'Power1-2',
            component: () => import('@/views/Power/BmpList.vue'),
            meta: {
              title: t('powerHzq.PersonnelList')
            }
          },
          {
            path: 'power1-3',
            name: 'Power1-3',
            component: () => import('@/views/Power/Menu12.vue'),
            meta: {
              title: t('powerHzq.Csm')
            }
          },
          {
            path: 'power1-4',
            name: 'Power1-4',
            component: () => import('@/views/Level/Menu12.vue'),
            meta: {
              title: t('powerHzq.Bvm')
            }
          }
        ]
      },
      {
        path: "日志管理",
        name: 'rzgl',
        component:getParentLayout(),
        redirect:'/QuanXian/CaoZuoRiZhi1.vue',
        meta:{
          title: "日志管理",
          alwaysShow: true
        },
        children: [
          {
            path:"操作日志",
            component: () => import('@/views/QuanXian/CaoZuoRiZhi.vue'),
            name: 'czrz',
            meta:{
              title: "操作日志"
            },
          },
          {
            path:"后台管理员登录日志",
            component: () => import('@/views/QuanXian/HouTaiGuanLiYuanDengLuRiZhi.vue'),
            name: 'htglydlrz',
            meta:{
              title: "后台管理员登录日志"
            },
          },
          {
            path:"前台用户登录日志",
            component: () => import('@/views/QuanXian/QianTaiYongHuDengLuRiZhi.vue'),
            name: 'qtrhdlrz',
            meta:{
              title: "前台用户登录日志"
            },
          },
          {
            path:"封号日志",
            component: () => import('@/views/QuanXian/FengHaoRiZhi.vue'),
            name: 'fhrz',
            meta:{
              title: "封号日志"
            },
          },
        ]
      },
      {
        path: "反馈管理",
        name: 'fkgl',
        component:getParentLayout(),
        redirect:'/QuanXian/FanKuiLieBiao.vue',
        meta:{
          title: "反馈管理",
          alwaysShow: true
        },
        children: [
          {
            path:"反馈列表",
            component: () => import('@/views/QuanXian/FanKuiLieBiao.vue'),
            name: 'fklb',
            meta:{
              title: "反馈列表"
            },
          },
        ]
      }

    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  strict: true,
  routes: constantRouterMap as RouteRecordRaw[],
  scrollBehavior: () => ({ left: 0, top: 0 })
})

export const resetRouter = (): void => {
  const resetWhiteNameList = ['Redirect', 'Login', 'NoFind', 'Root']
  router.getRoutes().forEach((route) => {
    const { name } = route
    if (name && !resetWhiteNameList.includes(name as string)) {
      router.hasRoute(name) && router.removeRoute(name)
    }
  })
}

export const setupRouter = (app: App<Element>) => {
  app.use(router)
}

export default router
